﻿
/*----------------------------------------------------------------//
// 文件名：MoContractgb.cs
// 文件功能描述：实体 MoContractgb.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoContractgb
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoContractgb
    /// </summary>
    public partial class MoContractgb : ICloneable
    {
        #region 表Contractgb的字段
        private string gbCode;
        private string reportId;
        #endregion

        #region 构造函数
        public MoContractgb()
        {


        }
        #endregion

        #region 拷贝构造函数

        public MoContractgb(MoContractgb item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoContractgb(string gbCode, string reportId)
        {
            this.gbCode = gbCode;
            this.reportId = reportId;
        }
        #endregion

        #region 表Contractgb的字段属性
        /// <summary>
        /// GB_CODE
        /// </summary>
        public string GbCode
        {
            get { return gbCode; }
            set { gbCode = value; }
        }
        /// <summary>
        ///编号规则为NO. LDYYMMXXX，其中NO.LD为固定前缀，YY表示年份，MM代表月份，XXX代表当月第几个报告。XXX为业务组手工录入。此编号不能重复。报告编号做为唯一值编号贯穿于整个系统流程（包括财务、业务、试验、报告等各部门）
        /// </summary>
        public string ReportId
        {
            get { return reportId; }
            set { reportId = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoContractgb CopyTo(MoContractgb item)
        {
            item.gbCode = this.gbCode;
            item.reportId = this.reportId;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoContractgb mo = new MoContractgb();
            mo.GbCode = this.GbCode;
            mo.ReportId = this.ReportId;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoContractgb NewContractgb = obj as MoContractgb;
                if (NewContractgb == null)
                {
                    return false;
                }
                else
                {
                    if (NewContractgb.GbCode == this.GbCode && NewContractgb.ReportId == this.ReportId)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "GbCode={0}/ReportId={1}", gbCode, reportId);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["GB_Code"] != null && row["GB_Code"] != DBNull.Value)
            {
                this.GbCode = (string)row["GB_Code"];
            }
            else
            {
                this.GbCode = string.Empty;
            }
            if (row["Report_ID"] != null && row["Report_ID"] != DBNull.Value)
            {
                this.ReportId = (string)row["Report_ID"];
            }
            else
            {
                this.ReportId = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["GB_Code"] = this.GbCode;
            row["Report_ID"] = this.ReportId;
        }
        #endregion
    }
}
#endregion
